{%insert header.tpl%}
<script type="text/javascript">
	$(document).ready(function() {$("a.imageloader").fancybox();});
</script>
<h2>
{%iterate Path as pcat%}
<a href="{% Link %}">{% context %}</a>\
{%iterate%}
{% Title %}
</h2>
<table class="product-info">
<tr>
{%with Product%}
<td class="photo">
	{%with Preview%}
		<a href="{% q < GetLink %}" class="cloud-zoom" id="zoom" rel="zoomHeight: 300,zoomWidth: 300,adjustX: 10, adjustY:-4, softFocus:true"><img src="{% q < GetThumbnailLink %}" /></a>
		<a id="fullsizeloader" class="imageloader" href="{% q < GetLink %}"><img src="{% q < $THEME_URL %}/img/imagefullsize.jpg" /><br/>Увеличить изображение</a>
	{%endwith%}
</td>
{%endwith%}
<td class="info" rowspan="2">
<div class="content">{%with ContentItem%}{%if PageContents%}{% PageContents %}{%else%}{%if Snippet%}{%Snippet%}{%else%}{@%Description%}{%endif%}{%endif%}{%endwith%}</div>
{%with Product%}
{%if Manufacturer%}
<div class="param manufacturer"><span class="label">Производитель:</span>&nbsp;{% Manufacturer %}</div>
{%endif%}
{%if Sizes%}
<div class="param sizes"><span class="label">Размеры:</span>&nbsp;{% Sizes %}</div>
{%endif%}
{%if Colors%}
<div class="param colors"><span class="label">Цвета:</span>&nbsp;{% Colors %}</div>
{%endif%}
{%if State%}
<div class="param state"><span class="label">Наличие:</span>&nbsp;{% i < State %}</div>
{%endif%}
<div class="buy-btn-holder">
{%if AllowOrder%}
	<div class="buy-now">Купить сейчас!</div>
	<a class="buy-btn" href="#" onclick="javascript:AddToCart({% Id %});return false;"><button type="button" title="В корзину">Купить</button></a>
{%endif%}	
	<div class="price">{% Price %}&nbsp;руб.</div>
</div>
{%endwith%}
</td>
</tr>
<tr>
<td class="gallery" colspan="2">
	{%iterate Images as im%}
		{%assign desc ``%}
		{%if Description%}
			{%assign desc Description%}
		{%endif%}
		{%with Preview%}
			{%assign previewurl GetThumbnailLink%}
		{%endwith%}
		{%with SmallThumbnail%}
		<a href="{% q < GetLink %}" class="cloud-zoom-gallery" title="{% desc %}" rel="useZoom: 'zoom', smallImage: '{% previewurl %}' "><img src="{% q < GetThumbnailLink %}" /></a>
		{%endwith%}
	{%iterate%}
	<script language="javascript">
		$(document).ready(function(){
			$('a.cloud-zoom-gallery').click(function(){$('#fullsizeloader').attr('href',this.href);});
		});
	</script>
</td>
</tr>
{%assign assoc Associations%}
{%with assoc%}
	{%if ItemCount%}
<tr>
<td class="page-associations" colspan="2">
<div class="assoc-title">Смотрите также:</div>
{%iterate context as a %}
	<a class="assoc-link" href="{% Link %}">
		{%assign rendered 0%}
		{%switch ClassName%}
			{%case `TMSProductPage`%}
				{%with Product%}
				{%if Icon%}
					{%with Icon%}
						<img src="{% GetThumbnailLink %}" />
					{%endwith%}
					{%assign rendered 0%}
				{%endif%}
				{%endwith%}
			{%endcase%}
		{%endswitch%}
		{%ifnot rendered%}{% context %}{%endif%}
	</a>&nbsp;
{%iterate%}
</td>
</tr>
	{%endif%}
{%endwith%}
</table>
<div class="comment-dialog">
<form method="post">
	<input type="hidden" name="method" value="AddComment" />
	{%ifnot User %}
	<div class="form-field-author"><span class="label">Автор:</span><input type="text" name="author" value="" /></div>
	{%endif%}
	<table>
	<tr>
	<td>
	<div class="form-field-comment">
	<div class="label">Комментарий:</div>
	<textarea name="comment"></textarea>
	</div>
	</td>
	{%ifnot User %}
	<td class="form-field-captcha">
		<img id="captcha" class="captcha-image" src="{% CaptchaUrl %}" />
		<div class="refresh-btn-holder">
			<button type="button" class="captcha-refresher" title="Обновить" onclick="javascript:$(&quot;#captcha&quot;).attr(&quot;src&quot;,&quot;{% q <  CaptchaUrl %}&amp;rand=&quot;+Math.random());return false;">Обновить</button>
		</div>
		<div class="label">Введите символы с картинки</div>
		<input type="text" name="captcha" value="" />
	</td>
	{%endif%}
	</tr>
	</table>
	<div class="btn-holder">	
		<button type="button" onclick="javascript:submit();" title="Оставить комментарий">Отправить</button>
	</div>
</form>
</div>
<div class="comments">
{%iterate Comments as com%}
<div class="comment{%odd%} odd{%endodd%}">
	<div class="info">{% AuthorName %}&nbsp;[{% Added %}]:</div>
	<div class="text">{% CommentText %}</div>
</div>
{%iterate%}
<div class="page-nav">
{%iterate 1 > CommentPagesCount%}
<a {%if counter CurrentListPage%} class="current"{%endif%}href="{% ListPageUrl < counter %}">{% counter %}</a>
{%iterate%}
</div>
</div>
{%insert footer.tpl%}
